package pl.com.hme.kody.pocztowe.exception;

import java.io.IOException;

import org.xmlpull.v1.XmlPullParser;

/**
 * General {@link IOException} that indicates a problem occured while
 * parsing or applying an {@link XmlPullParser}.
 */
public class ParserException extends IOException {

	private static final long serialVersionUID = 8342242999463931705L;

	public ParserException(String message) {
        super(message);
    }

    public ParserException(String message, Throwable cause) {
        super(message);
        initCause(cause);
    }

    @Override
    public String toString() {
        if (getCause() != null) {
            return getLocalizedMessage() + ": " + getCause();
        } else {
            return getLocalizedMessage();
        }
    }
}